home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
vdl020d.zip
/
VMEMNEW.DOC
< prev
next >
Wrap
Text File
|
1993-04-14
|
5KB
|
210 lines
(*
════════════════════════════════════════════════════════════════════════════
Visionix Memory Management Unit (VMEM)
Copyright 1991,1992 Visionix
ALL RIGHTS RESERVED
────────────────────────────────────────────────────────────────────────────
Revision history in reverse chronological order:
Initials Date Comment
──────── ──────── ────────────────────────────────────────────────────────
jrt 11/21/92 Sync with beta 0.08
jrt 08/01/92 First logged revision.
────────────────────────────────────────────────────────────────────────────
Known bugs/caveats:
════════════════════════════════════════════════════════════════════════════
*)
Unit VMem;
Uses
VTypes;
Const
allocZERO = $01;
Type
THeapHandle = POINTER;
THeapEventProc = Procedure( HeapEvent : POINTER );
THeapMethodProc = Procedure ( HeapDCB : POINTER );
TMemHandle = POINTER;
TMemHeader = RECORD
Locks : LONGINT;
Size : LONGINT;
Ptr : Pointer;
END;
PMemHeader = ^TMemHeader;
{------------}
{ Heap event }
{------------}
Type
THeapEvent = RECORD
EventCode : LONGINT;
Data1 : LONGINT;
Data2 : LONGINT;
Data3 : LONGINT;
END;
PHeapEvent = ^THeapEvent;
{---------------------------}
{ Heap Driver control block }
{---------------------------}
THeapDCB = RECORD
Func : WORD;
Flags : WORD;
Name : ST80;
HeapDriverProc : THeapDriverProc;
ID : POINTER;
HeapEventPRoc : THeapEventProc;
Size : LONGINT;
HeapHandle : THeapHandle;
MemHandle : TMemHandle;
Status : WORD;
END;
PHeapDCB = THeapDCB;
{----------------------}
{ Heap driver instance }
{----------------------}
PHeapDriverInstance = ^THeapDriverInstance;
THeapDriverInstance = RECORD
Flags : WORD;
Name : ST80;
HeapDriverProc : THeapDriverProc;
Data : POINTER;
Next : PHeapDriverInstance;
END;
Var
HeapDriverInstanceList : PHeapDriverInstance;
(*
Function VMemHeapDriverNew( Flags : WORD;
MethodName : ST80;
HeapDriverProc : THeapDriverProc;
HeapDriverID : POINTER ) : WORD;
Function VMemHeapNew( Flags : WORD;
MethodListStr : ST80;
HeapEventProc : THeapEventProc;
SizeK : LONGINT ):THeapHandle;
Procedure VMemHeapDispose( Flags : WORD;
Handle : THeapHandle );
*)
Function VMemAlloc( HeapHandle : THeapHandle;
Flags : WORD;
Size : LONGINT ):TMemHandle;
{ Allocates a memory handle. The memory is allocated from the }
{ heap associated with HeapHandle. The HeapHandle is obtained }
{ from a previous call to VMemHeapNew. }
{ }
{ Flags Allocation control flags }
{ allocZERO zero out allocated memory. }
{ }
{ [RETURNS] Memory Handle, }
{ 0 if error. }
Function VMemLock( MemHandle : TMemHandle ):Pointer;
{ Locks down the memory associated with a memory handle, and }
{ returns a pointer to it. }
{ }
{ MemHandle Previously allocated memory handle. }
{ }
{ [RETURNS] Pointer to memory, }
{ NIL if error. }
Procedure VMemUnlock( MemHandle : TMemHandle );
{ Unlocks the memory associated with a memory handle, invaliding }
{ any pointer to the memory previously obtained via VMemLock. }
{ }
{ MemHandle Previously allocated memory handle. }
{ }
Procedure VMemFree( MemHandle : TMemHandle );
{ VMemFree frees a memory handle and the memory associated with }
{ it. }
{ }
{ MemHandle Previously allocated memory handle. }
{---------------------------------------------------------------------------}